package edu.gduf;

import edu.gduf.domain.ResultInfo;
import edu.gduf.service.ActivityService;
import edu.gduf.utils.HtmlUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.IOException;

/**
 * @author 谢佳豪
 * @data 2020/10/9 - 21:09
 * @target
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
public class test {

    @Autowired
    private ActivityService activityService;


    @Test
    public void selectActivitiesByUid(){
        ResultInfo resultInfo = activityService.selectActivitiesByAid(8,1);
        System.out.println(resultInfo);
    }

    @Test
    public void choose(){
        ResultInfo resultInfo = activityService.reducePopulation(22, "datou");
        System.out.println(resultInfo);
    }


    @Test
    public void Test() throws IOException {
        System.out.println(System.getProperty("user.dir"));
    }

    @Test
    public void TestHtml(){
        String content = "<p>测试发信<img class=\"eleImg\" src=\"http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/50/pcmoren_huaixiao_org.png\" alt=\"[[坏笑]]\"></p>";
        System.out.println(HtmlUtil.delHTMLTag(content));
    }
}
